<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui"
template="/template/common/commonLayout.xhtml">
 
<ui:define name="content">

<h:form>
 <p:dataTable var="cart" value="#{CartWizard.getCart}" id="cartList">

        <f:facet name="header">
            Caddie
        </f:facet>

        <p:column headerText="Quantité" style="width:250px">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{cart.quantity}" />
                </f:facet>
                <f:facet name="input">
                    <h:selectOneMenu value="#{cart.quantity}" >
                        <f:selectItems value="#{CartWizard.qte}"
                            var="man" 
                            itemLabel="#{man}"
                            itemValue="#{man}" />
                    </h:selectOneMenu>
                </f:facet>
            </p:cellEditor>
        </p:column>

        <p:column headerText="Produit" style="width:250px">
            <f:facet name="output">
                <h:outputText value="#{cart.item}" />
            </f:facet>
        </p:column>

        <p:column headerText="Type d'Achat" style="width:250px">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{cart.item.location}" />
                </f:facet>
                <f:facet name="input">
                    <h:selectOneMenu value="Achat" >
                        <f:selectItems value="#{CartWizard.type}"
                            var="man" 
                            itemLabel="#{man}"
                            itemValue="#{man}" />
                    </h:selectOneMenu>
                </f:facet>
            </p:cellEditor>
        </p:column>

        <p:column headerText="Prix" style="width:250px">
            <f:facet name="output">
                <h:outputText value="#{cart.item.unitCost}" />
            </f:facet>
        </p:column>
        
        <p:column headerText="Modifier">
            <p:rowEditor />
        </p:column>
        
        <f:facet name="footer">
            Total #{cart.item.total} €.
        </f:facet>
    </p:dataTable>
    
    <p:commandButton value="Valider" update="growl" 
		actionListener="#{magasinBean.valider}"/>

</h:form>
</ui:define>
</ui:composition>
